import axios from '@/utils/axios'
// 终端
const addDeviceApi = '/sp_admin/business/device/add' // 新增终端
const editDeviceApi = '/sp_admin/business/device/update' // 编辑终端
const activeDeviceCodeApi = '/sp_admin/business/device/active_code' // 终端激活code
const unbindDeviceApi = '/sp_admin/business/device/unbind' // 终端解绑
const logoutDeviceApi = '/sp_admin/business/device/logout' // 终端退出登录
const deviceListApi = '/sp_admin/business/device/page' // 终端列表
const allDeviceListApi = '/sp_admin/business/device/all' // 终端列表
// 打印机
const editPrinterApi = '/sp_admin/business/printer/set_printer' // 新增更新打印机
const printerListApi = '/sp_admin/business/printer/page' // 打印机列表
const delPrinterApi = '/sp_admin/business/printer/remove' // 删除打印机
// 云音响
const addSpeakerApi = '/sp_admin/business/speaker/add' // 新增更新打印机
const editSpeakerApi = '/sp_admin/business/speaker/update' // 新增更新打印机
const speakerListApi = '/sp_admin/business/speaker/page' // 新增更新打印机
// 如意
const bindRuYiLiteApi = '/alipay/lite/servicer/bind' // 绑定如意
const unbindRuYiLiteApi = '/alipay/lite/servicer/unbind' // 解绑如意
const ruYiLiteListApi = '/alipay/lite/servicer/deviceList' // 如意列表
const alipayLiteMchListApi = '/alipay/lite/servicer/merchantList' // 阿里商户列表
const alipayLiteShopListApi = '/alipay/lite/servicer/aliShopList' // 阿里门店列表
/**
 * @desc 新增终端
 */
export const addDevice = ({ data }) => {
  return axios.post(addDeviceApi, data)
}

/**
 * @desc 编辑终端
 */
export const editDevice = ({ data }) => {
  return axios.post(editDeviceApi, data)
}

/**
 * @desc 终端激活code
 */
export const activeDeviceCode = ({ params }) => {
  return axios({
    url: activeDeviceCodeApi,
    method: 'post',
    params: params
  })
}

/**
 * @desc 解绑终端
 */
export const unbindDevice = ({ data }) => {
  return axios.post(unbindDeviceApi, data)
}

/**
 * @desc 终端退出登录
 */
export const logoutDevice = ({ data }) => {
  return axios.post(logoutDeviceApi, data)
}

/**
 * @desc 终端列表
 */
export const deviceList = ({ data }) => {
  return axios.post(deviceListApi, data)
}

/**
 * @desc 终端all
 */
export const allDeviceList = ({ params }) => {
  return axios({
    url: allDeviceListApi,
    method: 'get',
    params: params
  })
}

/**
 * @desc 编辑打印机
 */
export const editPrinter = ({ data }) => {
  return axios.post(editPrinterApi, data)
}

/**
 * @desc 打印机列表
 */
export const printerList = ({ data }) => {
  return axios.post(printerListApi, data)
}

/**
 * @desc 删除打印机
 */
export const delPrinter = ({ params }) => {
  return axios({
    url: delPrinterApi,
    method: 'delete',
    params: params
  })
}

/**
 * @desc 新增云喇叭
 */
export const addSpeaker = ({ data }) => {
  return axios.post(addSpeakerApi, data)
}

/**
 * @desc 编辑云喇叭
 */
export const editSpeaker = ({ data }) => {
  return axios.post(editSpeakerApi, data)
}

/**
 * @desc 云喇叭列表
 */
export const speakerList = ({ data }) => {
  return axios.post(speakerListApi, data)
}

/**
 * @desc 绑定如意
 */
export const bindRuYiLite = ({ data }) => {
  return axios.post(bindRuYiLiteApi, data)
}

/**
 * @desc 解绑如意
 */
export const unbindRuYiLite = ({ params }) => {
  return axios({
    url: unbindRuYiLiteApi,
    method: 'post',
    params: params
  })
}

/**
 * @desc 如意列表
 */
export const ruYiLiteList = ({ data }) => {
  return axios.post(ruYiLiteListApi, data)
}

/**
 * @desc 阿里商户列表
 */
export const alipayLiteMchList = ({ params }) => {
  return axios({
    url: alipayLiteMchListApi,
    method: 'get',
    params: params
  })
}

/**
 * @desc 阿里店铺列表
 */
export const alipayLiteShopList = ({ params }) => {
  return axios({
    url: alipayLiteShopListApi,
    method: 'get',
    params: params
  })
}

